import test from './modules/test'
import system from './modules/system'
import layout from "@/layout";

/**
 * 在主框架内显示
 */
const frameIn = [
    {
        path: '/',
        redirect: {name: 'Home'},
        component: layout,
        meta: {
            title: '主页',
            auth: true
        },
        children: [
            {
                path: '/Home',
                name: 'Home',
                meta: {
                    title: '首页',
                    auth: true
                },
                component: () => import('../views/Home.vue'),
            },

        ]
    },
    system,
    test,
]

/**
 * 在主框架之外显示
 */
const frameOut = [
    // 登录
    {
        path: '/login',
        name: 'login',
        meta: {
            title: '登录'
        },
        component: () => import('@/views/system/login/Index.vue'),
    }
]

/**
 * 错误页面
 */
const errorPage = [
    {
        //找不到页面的正则抓取函数:catchAll(.*)
        path: '/:catchAll(.*)',
        name: '/404',
        meta: {
            title: '404'
        },
        component: () => import('../views/system/404.vue')
    }
]


// 重新组织后导出
export default [
    ...frameIn,
    ...frameOut,
    ...errorPage
]